freecivfandomcom-20200223-history
Install-MacOSX
Introduction This section describes how to get Freeciv 2.0.4 running on Mac OS X 10.3 Panther. Freeciv also works reportedly well under 10.4 Tiger. Earlier versions (e.g. 10.2 Jaguar) are not supported. Binaries compiled for Panther will execute well on a Tiger system, while the opposite isn't true due to kernel level differences between the two versions. Install From Pre-built Binary This is the easiest way to get up and running. * Install Apple's X11. This is on CD 3 or DVD 1 of Mac OS X Panther, or DVD 1 of Mac OS X Tiger. If you for some reason does not have access to Mac OS X install discs, some versions of X11 can be downloaded from Apple's developer site. * Download the .dmg file from downloads. * Mount the disk image by double-clicking on it, if it is not already mounted. * Copy the top-level folder inside the mounted disk image to your hard disk. * Unmount the disk image. * See the Read Me.rtfd file for more information. Note that recent packages does not run on Panther. Either download an earlier package from more distributions, or attempt an install from source as outlined below. Install From Source This section's contents are taken, in part, from here. The good news is that Freeciv compiles on Mac OS X Panther without any source code modification. However, it takes some work to lay the foundation on so that you can compile Freeciv on top of it. But, the heavy lifting has been done for you by the excellent folks at DarwinPorts or Fink. These instructions will direct you to install DarwinPorts base as well as several ports on your machine. Fink works, too, but you'll have to find instructions for Fink elsewhere. Prepare Mac OS X Panther *Install X11 and X11 SDK components. Both are available on your Panther CD. However, X11 itself is also available as a download from Apple. *Install Xcode 1.2, 1.5 (For Panther) or 2 (For Tiger) Installing a Package Manager Installing Darwin Ports *Head over to DarwinPorts, follow the documentation to compile and install the base. This will get you the port command, man pages, and port files. *To build the GTK+ 2.0 client, for example, you need to install the gettext, glib2, pango, atk, and gtk2 ports, in the order specified. However, the gtk2 port depends on the other ports, and the port command is intelligent enough to go ahead and install those as well. Here is the command you will execute from the command line: % sudo port install gtk2 This port (and its dependencies) is what is absolutely needed to compile Freeciv. There is some optional stuff, such as sound support, that is not covered here. Installing Fink Instructions to install Fink can be found here. It's recomended that you use the included FinkCommander. You will want to install the following packages: * GTK2 * Glib2 Make sure you also install the shlib and dev pacakges when/if available. Compile and Install Freeciv *Grab the Freeciv source archive here and extract it. *Read the INSTALL file located in the top-level directory of the archive. It contains information on which ports you will need to build the GTK+2 client for Freeciv. *To build the GTK+2 client, execute this configure command from the command line, at the top-level directory of the source archive: % env CC="gcc -no-cpp-precomp" CFLAGS="-O3" ./configure \ --enable-client=gtk2 \ --prefix=/Users/your_user_name/freeciv-2.0.4 *Compile the source by executing this command: % make *Assuming everything compiles properly, execute this command to install it in directory you specified as the prefix: % make install *Now, you should be able to find three executables in the /''prefix''/bin directory: civclient civserver civmanual You might have success in launching the client by simply double-clicking on the civclient executable from within the Finder. Other Clients Freeciv supports several other clients. On Mac OS X, the GTK+1, GTK+2, SDL, and xaw clients can be built. However, GTK+2 is the recommended client (GTK+1 client is deprecated). Although if you deplore having to install either DarwinPorts or Fink, xaw client is an option. SDL Client The SDL client has improved a lot in the 2.1-beta3 release. It requires some hacks to compile, but it is definitely worth the sweat as it provides a quite different experience than the other clients. The instructions below are for OS X 10.3.9 on an iBook G3, and might or might not work on other setups. --Hima 08:41, 19 February 2007 (UTC) The required packages are: #'SDL' http://www.libsdl.org/download-1.2.php #'libpng' http://www.libpng.org/pub/png/libpng.html #'freetype' http://freetype.sourceforge.net/download.html #'SDL_image' http://www.libsdl.org/projects/SDL_image/ *''Caveat 1:'' Darwinports did not install all necessary headers for me, so I had to install the important packages manually. Download the source tarballs from the links above. *''Caveat 2:'' I had to compile SDL_image with the following variables to make it work: ./configure --disable-tif --disable-tif-shared --disable-jpg --disable-jpg-shared *''Caveat 3:'' To get SDL to work, I had to add the option "-Dmain=SDL_main" to the "--cflags)" part in the /usr/local/bin/sdl-config script Build and install in above order, then compile the Freeciv tarball with "--enable-client=sdl". If you get stuck, you might get some help from an installation guide for another SDL-based game at http://girasoli.org/?p=73 SDL Client with MacPorts I've been able to build the SDL client using the libs provided by macports (formerly darwinports). Changing the "--cflags)" section of /opt/local/bin/sdl-config to -I${prefix}/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -I${prefix}/include/ -Dmain=SDL_main did the trick for me… Have fun, Stephan Sound Support Using DarwinPorts You need to install the following ports for SDL sound support: * libsdl * libsdl_mixer You'll also need to download a soundset. You can find information about sounds and sound sets here. When running Freeciv's configure script, be sure to use the following option: --with-sdl-prefix=/opt/local Furthermore, you need to define your CC environment variable to be the following: gcc -no-cpp-precomp -I/opt/local/include -L/opt/local/lib After you have built the binaries, copy the .soundspec file, and the accompanying folder containing the actual sound files from the sound set archive into your path_to_freeciv/share/freeciv directory. Localization Support Using DarwinPorts You need to have a functioning installation of the gettext package to be able to run Freeciv with a language other than English. When running Freeciv's configure script, be sure to use the following option: --enable-nls Furthermore, you need to define your CC environment variable to be the following (to where DarwinPorts install packages): gcc -no-cpp-precomp -I/opt/local/include -L/opt/local/lib You may start either the server or client or both in the locale of your choice by giving a full LANG prefix when executing them. E.g. the civclient in Swedish locale: LANG=sv_SE.UTF-8 civclient Note that by giving a full locale string as the example above, you avoid potential encoding conversion warnings and glitches. Potential Errors During Compiling Compiling Freeciv using the before specified commands may yield the following error: stdinhand.c: In function 'freeciv_completion': stdinhand.c:4509: error: 'rl_attempted_completion_over' undeclared (first use in this function) stdinhand.c:4509: error: (Each undeclared identifier is reported only once stdinhand.c:4509: error: for each function it appears in.) make3: *** stdinhand.o Error 1 make2: *** all-recursive Error 1 make1: *** all-recursive Error 1 make: *** all Error 2 A workaround for this problem was mentioned at the Freeciv-Dev Mailing list: You can probably work around it by running ./configure --without-readline. However it would be nice to fix it if you'll help us track down the problem. This applies to users of Mac OS X 10.4 (Tiger). Caveats From Freeciv, a Wikia wiki.